import type { postOrPutType } from "@/constants";
import type { IResult } from "@/types/common";
import { getAxios, commonAxiosJson, deleteAxios } from "@/utils/request.ts";
const url = "/back/master-auth";

/* 获取菜单信息 */
export const getMenuInfo = <T, D>(params?: D): Promise<IResult<T>> => {
  return getAxios<T, D>(url, params);
};
/* 新增，更新菜单信息 */
export const commonMenuInfo = <T, D>(params: D, type: postOrPutType): Promise<IResult<T>> => {
  return commonAxiosJson<T, D>(url, params, type);
};
/* 删除菜单信息 */
export const deleteMenuInfo = <T, D>(params: D): Promise<IResult<T>> => {
  return deleteAxios<T, D>(url, params);
};
